package com.office.supplies.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.office.supplies.mapper.StockMapper;
import com.office.supplies.pojo.dto.SelectStockDTO;
import com.office.supplies.pojo.vo.SelectStockVO;
import com.office.supplies.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author admin
 * @Description TODO
 * @Date 2023/12/11/23:33
 */
@Service
public class StockServiceImpl implements StockService {

    @Autowired
    private StockMapper stockMapper;

    /**
     * 查询库存
     *
     * @param pageNum Integer
     * @param pageSize Integer
     * @param selectStockDTO SelectStockDTO
     * @return PageInfo<SelectStockVO>
     */
    public PageInfo<SelectStockVO> getStockList(Integer pageNum, Integer pageSize, SelectStockDTO selectStockDTO) {
        PageHelper.startPage(pageNum,pageSize);
        List<SelectStockVO> selectStockVOS = stockMapper.getStockListByCondition(selectStockDTO);
        return new PageInfo<>(selectStockVOS);
    }

}
